package com.siva.domain.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.siva.domain.Customer;

@Mapper
public interface CustomerMapper {
    
    @Select("SELECT * FROM CUSTOMER WHERE ID = #{id}")
    Customer findById(@Param("id") long id);
    
    @Select("SELECT * FROM CUSTOMER WHERE NAME = #{name}")
    Customer findByName(@Param("name") String name);
    
    @Insert("INSERT INTO CUSTOMER(NAME, AGE) VALUES(#{name}, #{age})")
    int insert(@Param("name") String name, @Param("age") int age);
}
